package com.qys.livesMall.finance.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qys.livesMall.finance.dao.FinanceAccountDao;
import com.qys.livesMall.finance.mapper.FinanceAccountMapper;
import com.qys.livesMall.finance.model.entity.FinanceAccount;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @menu FinanceAccountDaoImpl
 * @date 2023/07/29 16:14
 */
@Service
public class FinanceAccountDaoImpl extends ServiceImpl<FinanceAccountMapper, FinanceAccount> implements FinanceAccountDao {

    @Override
    public FinanceAccount getByType(Integer type) {
        LambdaQueryWrapper<FinanceAccount> qw=new LambdaQueryWrapper<>();
        qw.eq(FinanceAccount::getType,type);
        qw.last("limit 1");
        return getOne(qw);
    }
}

